#include "Widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
    connect(ui->label, SIGNAL(clicked()),
            this, SLOT(setText()));


    //滚轮事件
    virtual void wheelEvent(QWheelEvent *event);

}


void Widget::setText()
{
    QString text = ui->lineEdit->text();
    if(text.isEmpty()){
        return ;
    }

    ui->textEdit->append(text);
    ui->lineEdit->clear();
}

Widget::~Widget()
{
    delete ui;
}
